import request from "@/utils/request";
import type { RootObject,HospitalLevelAndRegionResponseData, HospitalInfo } from './type'

enum API {
    HOSPITALDETAIL_URL = '/hosp/hospital/',
    HOSPITALLEVElANDREGION_URL = '/cmn/dict/findByDictCode/',
    //根据关键字医院的名字获取数据
    HOSPITALINFO_URL = '/hosp/hospital/findByHosname/'
}

export const reqHospitalDetail = (page: number, limit: number, hostype: string, districtCode: string) => request.get<any, RootObject>(API.HOSPITALDETAIL_URL + `${page}/${limit}?hostype=${hostype}&districtCode=${districtCode}`)
export const reqHospitalLevelAndRegion = (dictCode: string) => request.get<any, HospitalLevelAndRegionResponseData>(API.HOSPITALLEVElANDREGION_URL + dictCode)
export const reqHospitalInfo = (hosname:string)=>request.get<any,HospitalInfo>(API.HOSPITALINFO_URL + hosname)